<?php
/**
 *
 * @author snipe@crebird.com
 *
 */
class ExtSort extends CSort
{
  public function extLink($attribute, $label=null, $htmlOptions=array())
  {
    $label = $label . '<extra>';
    $link = $this->link($attribute, $label, $htmlOptions);
    if ($this->getDirection($attribute) === NULL) {
      $extra = '<span class="DataTables_sort_icon css_right ui-icon ui-icon-carat-2-n-s"></span>';
    } else if ($this->getDirection($attribute)) {
      $extra = '<span class="DataTables_sort_icon css_right ui-icon ui-icon-triangle-1-s"></span>';
    } else {
      $extra = '<span class="DataTables_sort_icon css_right ui-icon ui-icon-triangle-1-n"></span>';
    }

    $link = str_replace('<extra>', $extra, $link);

    return  $link;
  }
}